import requests

from api.login import Login


class Platform_User(Login):
    # def __init__(self):
    #     self.token = 'platformc0188ce204be4228b8e8828a14854251'



    def user_inquire(self,phone):
        '''用户查询'''
        data = {
            'method': 'get',
            'url': '/api/admin/platform/user/list',
            'headers': {'authori-zation': self.pingtai_token},
            'params': {
                'tagIds': '',
                'sex': '',
                'registerType': '',
                'payCount': '',
                'accessType': '0',
                'dateLimit': '',
                'nikename': '',
                'phone': phone,
                'page': '1',
                'limit': '20',
                'temp': '1719564939',
            }
        }
        # r = requests.request(**data)
        return self.pingtai_qingqiu(data)
        # return r.json()



    def user_tag_inquire(self):
        '''用户tag查询'''
        pass



    def user_revise_integral(self):
        '''用户修改积分'''
        pass



    def user_revise_balance(self,uid,money):

        '''用户修改余额'''
        data = {
            'method': 'get',
            'url': 'https://api.admin.merchant.java.crmeb.net/api/admin/platform/user/operate/balance',
            'headers': {'authori-zation': self.pingtai_token },
            'params': {
                'integral': '0',
                'operateType': 'add',
                'uid': uid,
                'money': money,
                'temp': '1719563905',
            }
        }
        r = requests.request(**data)
        return r.json()


if __name__ == '__main__':
    obj = Platform_User()
    print(obj.user_inquire("13214251568"))
